import request from '@/utils/request'

export function getPermissionPage(params) {
    return request({
        url: `/api/v1/core/permission/page`,
        method: 'post',
        data: params
    })
}

export function addPermission(params) {
    return request({
        url: `/api/v1/core/permission/add`,
        method: 'post',
        data: params
    })
}

export function updatePermission(params) {
    return request({
        url: `/api/v1/core/permission/update`,
        method: 'post',
        data: params
    })
}

export function deletePermission(params) {
    return request({
        url: `/api/v1/core/permission/delete?id=${params.id}`,
        method: 'get'
    })
}

export function getPermissionAllocMenus(params) {
    return request({
        url: `/api/v1/core/permission/alloc/menus?id=${params.id}`,
        method: 'get'
    })
}

export function setPermissionRelMenu(params) {
    return request({
        url: `/api/v1/core/permission/rel/menu`,
        method: 'post',
        data: params
    })
}

